home *** CD-ROM | disk | FTP | other *** search
Makefile | 1992-08-07 | 2.3 KB | 88 lines |
- # get cisco IP accounting stuff
- # 1.5 90/06/20
- #
- ###### configuration
-
- # directory where the binaries and scripts go
- ETCDIR = /usr/local/etc
- # file for the raw accounting data
- LOGFILE = /usr/spool/log/ipacct
- # file for the processed and compressed accounting samples
- COMPFILE = /usr/spool/log/ipcomp
-
- # command to query ripe database (comment out if you don't have this)
- RIPEDBCMD = /usr/local/net
-
- # maximum number of values in summaries
- NTOP = 30
- # cutoff percentage for summaries
- # (lines representing less traffic are suppressed)
- CUTPCT = 1
-
- # default gateway
- SERVER = cwi-gw.cwi.nl
-
- # prompts for input during dialogue
- # these should really be determined by the program
- PROMPT1 = Password:
- PROMPT2 = cwi-gw>
- PROMPT3 = cwi-gw\#
-
- # the passwords
- NORMALPASSWORD = example
- ENABLEPASSWORD = example
-
- #########################################
-
- CFLAGS = -O
- TARGETS = getipacct nameipacct ciscotalk
-
- all: $(TARGETS)
-
- param.sed: Makefile
- echo "s:ETCDIR:$(ETCDIR):g" >param.sed
- echo "s:LOGFILE:$(LOGFILE):g" >>param.sed
- echo "s:COMPFILE:$(COMPFILE):g" >>param.sed
- echo "s:NTOP:$(NTOP):g" >>param.sed
- echo "s:CUTPCT:$(CUTPCT):g" >>param.sed
- echo "s:NORMALPASSWORD:$(NORMALPASSWORD):g" >>param.sed
- echo "s:ENABLEPASSWORD:$(ENABLEPASSWORD):g" >>param.sed
- chmod 600 param.sed
-
- ciscotalk.h: Makefile
- echo '#define SERVER "$(SERVER)"' > ciscotalk.h
- echo '#define PROMPT1 "$(PROMPT1)"' >> ciscotalk.h
- echo '#define PROMPT2 "$(PROMPT2)"' >> ciscotalk.h
- echo '#define PROMPT3 "$(PROMPT3)"' >> ciscotalk.h
-
- nameipacct.h: Makefile
- echo '#define RIPEDBCMD "$(RIPEDBCMD)"' >> nameipacct.h
-
- ciscotalk: ciscotalk.h ciscotalk.c
- $(CC) $(CFLAGS) -o ciscotalk ciscotalk.c
-
- nameipacct: nameipacct.h nameipacct.c
- $(CC) $(CFLAGS) -o nameipacct nameipacct.c
-
- getipacct: getipacct.sh param.sed
- sed -f param.sed <getipacct.sh >getipacct
- chmod 700 getipacct
-
- install: $(TARGETS)
- cp ciscotalk getipacct nameipacct $(ETCDIR)
- chmod 700 $(ETCDIR)/getipacct
- chmod 770 $(ETCDIR)/ciscotalk
- chmod 770 $(ETCDIR)/nameipacct
-
- agg: $(LOGFILE) agg.awk
- awk -f agg.awk <$(LOGFILE) | sort -rn +3 >agg
- clean:
- rm -f $(TARGETS) *.o ,* core tmp* param.sed ciscotalk.h nameipacct.h
-
- distrib:
- mv Makefile Makefile.bak
- sed -f distrib.sed <Makefile.bak >Makefile
- packmail -odistrib -t'ipacct stuff' `cat DISTRIB`
- rm -f Makefile
- mv Makefile.bak Makefile
-